<?php
$match = Frontend::findMatchByTimeStamp((int) $_today)->limit(6);
$match_tamdiem = Frontend::findMatchByLevel((int) $_today)->limit(6);
$news = Frontend::findAllNews()->limit(6);
?>
<div class="thumbnail">
    <div class="caption">
        <ul style="text-transform:uppercase;" class="nav nav-tabs tab">
            <li class="active">
                <a data-toggle="tab" href="#tam-diem">Trận tâm điểm</a>
            </li>
            <li class="">
                <a data-toggle="tab" href="#sap">Sắp diễn ra</a>
            </li>
        </ul>
        <div class="tab-content">
            <div style="background:#fff; padding-bottom: 10px;" class="tab-pane fade active in" id="tam-diem">
                <ul class="tb">
                    <li class="tb-tit">
                        <div class="tb-tit-tg">Thời gian</div>
                        <div class="tb-tit-team">&nbsp;</div>
                        <div></div>
                    </li>
                    <?php
                    foreach ($match_tamdiem as $_match) {
                        $team1 = Frontend::findTeamById((int) $_match["Team1"]);
                        $team2 = Frontend::findTeamById((int) $_match["Team2"]);
                        $link_match = Frontend::findTournamentById((int) $_match["TourID"]);

                        foreach ($team1 as $_team1)
                            $t1 = $_team1["name"];
                        foreach ($team2 as $_team2)
                            $t2 = $_team2["name"];

                        $str_team = trim(Core::str_process($t1 . " " . $t2));
                        $link_team = strtolower(preg_replace('/[^a-z0-9]+/i', '-', $str_team));
                        ?>
                        <li class="tb-body">
                            <div class="tb-tit-tg"><?php echo date("d/m/Y h:i", $_match["DateMatchTS"]); ?></div>
                            <div class="tb-tit-team" style="text-align: left">
                            <!--<img src="images/1c6DAzIKZcZAHjCCDtbP.png" width="30px"/>-->
                                <?php foreach ($link_match as $_link_match) { ?>
                                <a href="<?php echo SKIN_FPATH . "dudoan/" . $_link_match["location"] . "/" . $link_team . "/" . $_match["_id"] ?>">
                                    <?php echo $t1 . " - " . $t2; ?>
                                </a>
                                <?php } ?>
                                <!--<img src="images/3blMGNMkgWCqQ6swsOtp.png" width="30px"/>-->
                            </div>
                            <div style="width: 10px;">
                                <?php foreach ($link_match as $_link_match) { ?>
                                    <a href="<?php echo SKIN_FPATH . "dudoan/" . $_link_match["location"] . "/" . $link_team . "/" . $_match["_id"] ?>">
                                        <img style="max-width: none !important;" src="<?php echo SKIN_FPATH ?>skin/frontend/icon/red.png">
                                    </a>
                                <?php } ?>
                            </div>
                        </li>
                    <?php } ?>
                </ul>
            </div>
            <!-- Sắp diễn ra-->
            <div class="tab-pane fade" id="sap">
                <ul class="tb">
                    <li class="tb-tit">
                        <div class="tb-tit-tg">Thời gian</div>
                        <div class="tb-tit-team">&nbsp;</div>
                        <div></div>
                    </li>
                    <?php
                    foreach ($match as $_match) {
                        $team1 = Frontend::findTeamById((int) $_match["Team1"]);
                        $team2 = Frontend::findTeamById((int) $_match["Team2"]);
                        $link_match = Frontend::findTournamentById((int) $_match["TourID"]);

                        foreach ($team1 as $_team1)
                            $t1 = $_team1["name"];
                        foreach ($team2 as $_team2)
                            $t2 = $_team2["name"];

                        $str_team = trim(Core::str_process($t1 . " " . $t2));
                        $link_team = strtolower(preg_replace('/[^a-z0-9]+/i', '-', $str_team));
                        ?>
                        <li class="tb-body">
                            <div class="tb-tit-tg" style="margin-top: 8px"><?php echo date("d/m/Y h:i", $_match["DateMatchTS"]); ?></div>
                            <div class="tb-tit-team" style="text-align: left">
                            <!--<img src="images/1c6DAzIKZcZAHjCCDtbP.png" width="30px"/>-->
                                <?php foreach ($link_match as $_link_match) { ?>
                                <a href="<?php echo SKIN_FPATH . "dudoan/" . $_link_match["location"] . "/" . $link_team . "/" . $_match["_id"] ?>">
                                    <?php echo $t1 . " - " . $t2; ?>
                                </a>
                                <?php } ?>
                            <!--<img src="images/3blMGNMkgWCqQ6swsOtp.png" width="30px"/>-->
                            </div>
                            <div style="width: 10px;">
                                <?php foreach ($link_match as $_link_match) { ?>
                                    <a href="<?php echo SKIN_FPATH . "dudoan/" . $_link_match["location"] . "/" . $link_team . "/" . $_match["_id"] ?>">
                                        <img style="max-width: none !important;" src="<?php echo SKIN_FPATH ?>skin/frontend/icon/red.png">
                                    </a>
                                <?php } ?>
                            </div>
                        </li>
                    <?php } ?>
                </ul>
            </div>
        </div>
    </div>
</div><div class="thumbnail">
    <div class="caption">
        <ul style="text-transform:uppercase;" class="nav nav-tabs tab">
            <li class="active"><a data-toggle="tab" href="#tin-tuc">Bản tin dự đoán</a></li>
            <!--<li class=""><a data-toggle="tab" href="#tieu-diem">Tiêu điểm</a></li>-->
        </ul>
        <div style="margin-top:-3px;" class="tab-content">
            <div style="background:#fff; padding-bottom: 10px;margin-top:5px;position:relative;margin-bottom: 50px;" class="tab-pane fade active in" id="tin-tuc">
                <div class="media bg-media box-bg-media">
                    <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/nhan-biet-hu-hong-tu-tieng-on-tren-xe-337.html" class="pull-left">
                        <img data-src="http://tttv.vn/images/shop_1379900275.jpg" class="media-object" src="http://tttv.vn/images/shop_1379900275.jpg">
                    </a>
                    <div class="media-body">
                        <h5 class="media-heading">
                            <a class="tit2" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/nhan-biet-hu-hong-tu-tieng-on-tren-xe-337.html">
                                Nhận biết hư hỏng từ tiếng ồn trên xe
                            </a>
                        </h5>
                        <p class="date">Thứ 23/09/2013 08:37</p>
                    </div>
                </div>
                1
                <div class="media bg-media box-bg-media">
                    <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/huong-dan-thay-lop-du-phong-va-nhung-tai-nan-thuong-gap-khi-thay-lop-doc-duong-336.html" class="pull-left">
                        <img data-src="http://tttv.vn/images/shop_1379900193.jpg" class="media-object" src="http://tttv.vn/images/shop_1379900193.jpg">
                    </a>
                    <div class="media-body">
                        <h5 class="media-heading">
                            <a class="tit2" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/huong-dan-thay-lop-du-phong-va-nhung-tai-nan-thuong-gap-khi-thay-lop-doc-duong-336.html">
                                Hướng dẫn thay lốp dự phòng và những tai nạn thường gặp khi thay lốp dọc đường
                            </a>
                        </h5>
                        <p class="date">Thứ 23/09/2013 08:36</p>
                    </div>
                </div>
                2
                <div class="media bg-media box-bg-media">
                    <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/cac-loai-phi-phai-nop-khi-mua-xe-o-to-cu-335.html" class="pull-left">
                        <img data-src="http://tttv.vn/images/shop_1379900044.jpg" class="media-object" src="http://tttv.vn/images/shop_1379900044.jpg">
                    </a>
                    <div class="media-body">
                        <h5 class="media-heading">
                            <a class="tit2" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/cac-loai-phi-phai-nop-khi-mua-xe-o-to-cu-335.html">
                                Các loại phí phải nộp khi mua xe ô tô cũ
                            </a>
                        </h5>
                        <p class="date">Thứ 23/09/2013 08:34</p>
                    </div>
                </div>
                3
                <div class="media bg-media box-bg-media">
                    <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/ngat-ngay-voi-bo-suu-tap-sieu-xe-cua-dai-gia-tinh-le-gia-80-ty-334.html" class="pull-left">
                        <img data-src="http://tttv.vn/images/shop_1379899875.jpg" class="media-object" src="http://tttv.vn/images/shop_1379899875.jpg">
                    </a>
                    <div class="media-body">
                        <h5 class="media-heading">
                            <a class="tit2" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/ngat-ngay-voi-bo-suu-tap-sieu-xe-cua-dai-gia-tinh-le-gia-80-ty-334.html">
                                Ngất ngây với bộ sưu tập siêu xe của đại gia tỉnh lẻ giá 80 tỷ
                            </a>
                        </h5>
                        <p class="date">Thứ 23/09/2013 08:31</p>
                    </div>
                </div>
                4
                <div class="news-orther">
                    <div class="news-orther-l">
                        <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/brabus-tang-luc-cho-khung-long-mercedes-benz-g63-amg-6×6-333.html">
                            &nbsp;►&nbsp;Brabus tăng lực cho khủng long Mercedes-Benz...
                        </a>
                    </div>
                    <div class="news-orther-r" style="">
                        <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/brabus-tang-luc-cho-khung-long-mercedes-benz-g63-amg-6×6-333.html" class="pull-left">
                            <img data-src="http://tttv.vn/images/shop_1379899747.jpg" class="media-object" src="http://tttv.vn/images/shop_1379899747.jpg">
                        </a>
                    </div>
                </div>
                5
                <div class="news-orther">
                    <div class="news-orther-l">
                        <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/cac-dong-xe-cua-lexus-332.html">
                            &nbsp;►&nbsp;Các dòng xe của Lexus
                        </a>
                    </div>
                    <div class="news-orther-r" style="">
                        <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/cac-dong-xe-cua-lexus-332.html" class="pull-left">
                            <img data-src="http://tttv.vn/images/shop_1379673377.jpg" class="media-object" src="http://tttv.vn/images/shop_1379673377.jpg">
                        </a>
                    </div>
                </div>
                6
                <div class="news-orther">
                    <div class="news-orther-l">
                        <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/ural-m70-solo-limited-edition-doc-nhat-viet-nam-331.html">
                            &nbsp;►&nbsp;Ural M70 Solo Limited Edition độc nhất Việt Nam
                        </a>
                    </div>
                    <div class="news-orther-r" style="">
                        <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/ural-m70-solo-limited-edition-doc-nhat-viet-nam-331.html" class="pull-left">
                            <img data-src="http://tttv.vn/images/shop_1379673273.jpg" class="media-object" src="http://tttv.vn/images/shop_1379673273.jpg">
                        </a>
                    </div>
                </div>
                7
                <div class="news-orther">
                    <div class="news-orther-l">
                        <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/me-man-voi-mclaren-mp4-vx-330.html">
                            &nbsp;►&nbsp;Mê mẩn với McLaren MP4-VX
                        </a>
                    </div>
                    <div class="news-orther-r" style="">
                        <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/me-man-voi-mclaren-mp4-vx-330.html" class="pull-left">
                            <img data-src="http://tttv.vn/images/shop_1379899633.jpg" class="media-object" src="http://tttv.vn/images/shop_1379899633.jpg">
                        </a>
                    </div>
                </div>
                8
                <div class="news-orther">
                    <div class="news-orther-l">
                        <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/nhung-mau-sedan-hang-sang-danh-cho-cac-ong-chu-329.html">
                            &nbsp;►&nbsp;Những mẫu sedan hạng sang dành cho các ông...
                        </a>
                    </div>
                    <div class="news-orther-r" style="">
                        <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/nhung-mau-sedan-hang-sang-danh-cho-cac-ong-chu-329.html" class="pull-left">
                            <img data-src="http://tttv.vn/images/shop_1379672984.jpg" class="media-object" src="http://tttv.vn/images/shop_1379672984.jpg">
                        </a>
                    </div>
                </div>
                9
                <div class="news-orther">
                    <div class="news-orther-l">
                        <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/6-dieu-nen-chu-y-de-chon-duoc-chiec-xe-tot-328.html">
                            &nbsp;►&nbsp;6 điều nên chú ý để chọn được chiếc...
                        </a>
                    </div>
                    <div class="news-orther-r" style="">
                        <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/6-dieu-nen-chu-y-de-chon-duoc-chiec-xe-tot-328.html" class="pull-left">
                            <img data-src="http://tttv.vn/images/shop_1379672902.jpg" class="media-object" src="http://tttv.vn/images/shop_1379672902.jpg">
                        </a>
                    </div>
                </div>
                10
                <div class="news-orther">
                    <div class="news-orther-l">
                        <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/phanh-abs-hoat-dong-o-toc-do-bao-nhieu-327.html">
                            &nbsp;►&nbsp;Phanh ABS hoạt động ở tốc độ bao nhiêu?
                        </a>
                    </div>
                    <div class="news-orther-r" style="">
                        <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/phanh-abs-hoat-dong-o-toc-do-bao-nhieu-327.html" class="pull-left">
                            <img data-src="http://tttv.vn/images/shop_1379672816.jpg" class="media-object" src="http://tttv.vn/images/shop_1379672816.jpg">
                        </a>
                    </div>
                </div>
                11
                <div class="news-orther">
                    <div class="news-orther-l">
                        <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-va-cuoc-song/kinh-nghiem-lai-xe-mua-mua-bao-326.html">
                            &nbsp;►&nbsp;Kinh nghiệm lái xe mùa mưa bão
                        </a>
                    </div>
                    <div class="news-orther-r" style="">
                        <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-va-cuoc-song/kinh-nghiem-lai-xe-mua-mua-bao-326.html" class="pull-left">
                            <img data-src="http://tttv.vn/images/" class="media-object" src="http://tttv.vn/images/">
                        </a>
                    </div>
                </div>
                12
            </div>
            <div style="background:#fff; padding-bottom: 10px;margin-top:5px" class="tab-pane fade" id="tieu-diem">
                <div class="media bg-media box-bg-media">
                    <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/brabus-tang-luc-cho-khung-long-mercedes-benz-g63-amg-6×6-333.html" class="pull-left">
                        <img width="125px" height="80px" data-src="http://tttv.vn/images/shop_1379899747.jpg" class="media-object" src="http://tttv.vn/images/shop_1379899747.jpg">
                    </a>
                    <div class="media-body">
                        <h5 class="media-heading">
                            <a class="tit2" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/brabus-tang-luc-cho-khung-long-mercedes-benz-g63-amg-6×6-333.html">
                                Brabus tăng lực cho khủng long Mercedes-Benz G63 AMG 6×6
                            </a>
                        </h5>
                        <p class="date">Thứ 23/09/2013 08:29</p>
                    </div>
                </div>
                1
                <div class="media bg-media box-bg-media">
                    <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/phanh-abs-hoat-dong-o-toc-do-bao-nhieu-327.html" class="pull-left">
                        <img width="125px" height="80px" data-src="http://tttv.vn/images/shop_1379672816.jpg" class="media-object" src="http://tttv.vn/images/shop_1379672816.jpg">
                    </a>
                    <div class="media-body">
                        <h5 class="media-heading">
                            <a class="tit2" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/xe-360/phanh-abs-hoat-dong-o-toc-do-bao-nhieu-327.html">
                                Phanh ABS hoạt động ở tốc độ bao nhiêu?
                            </a>
                        </h5>
                        <p class="date">Thứ 20/09/2013 17:26</p>
                    </div>
                </div>
                2
                <div class="media bg-media box-bg-media">
                    <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/cac-mon-khac/khai-mac-giai-bong-ban-tranh-cup-bao-hano-imoi-mo-rong-lan-thu-ii-321.html" class="pull-left">
                        <img width="125px" height="80px" data-src="http://tttv.vn/images/shop_1379671832.JPG" class="media-object" src="http://tttv.vn/images/shop_1379671832.JPG">
                    </a>
                    <div class="media-body">
                        <h5 class="media-heading">
                            <a class="tit2" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/cac-mon-khac/khai-mac-giai-bong-ban-tranh-cup-bao-hano-imoi-mo-rong-lan-thu-ii-321.html">
                                Khai mạc Giải bóng bàn tranh cúp Báo Hànộ imới mở rộng lần thứ II
                            </a>
                        </h5>
                        <p class="date">Thứ 20/09/2013 17:10</p>
                    </div>
                </div>
                3
                <div class="media bg-media box-bg-media">
                    <a key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/cac-mon-khac/andy-murray-gianh-chuc-vo-dich-wimbledon-2013-320.html" class="pull-left">
                        <img width="125px" height="80px" data-src="http://tttv.vn/images/shop_1380159252.jpg" class="media-object" src="http://tttv.vn/images/shop_1380159252.jpg">
                    </a>
                    <div class="media-body">
                        <h5 class="media-heading">
                            <a class="tit2" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/cac-mon-khac/andy-murray-gianh-chuc-vo-dich-wimbledon-2013-320.html">
                                Andy Murray giành chức vô địch Wimbledon 2013
                            </a>
                        </h5>
                        <p class="date">Thứ 20/09/2013 17:08</p>
                    </div>
                </div>
                4
                <p>
                    <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/cac-mon-khac/cj-group-tai-tro-cho-nu-tuyen-thu-taekwondo-viet-nam-319.html">
                        &nbsp;►&nbsp;CJ Group tài trợ cho nữ tuyển thủ Taekwondo Việt Nam
                    </a>
                </p>
                5
                <p>
                    <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/viet-nam/tuyen-nu-viet-nam-vao-ban-ket-giai-vo-dich-dong-nam-a-307.html">
                        &nbsp;►&nbsp;Tuyển nữ Việt Nam vào bán kết Giải vô địch Đông Nam Á
                    </a>
                </p>
                6
                <p>
                    <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/bong-da/u19-viet-nam-ve-nhi-bong-da-tu-te-len-ngoi-299.html">
                        &nbsp;►&nbsp;U19 Việt Nam về nhì - Bóng đá tử tế lên ngôi
                    </a>
                </p>
                7
                <p>
                    <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/bong-da/nhung-dieu-can-biet-ve-le-boc-tham-chia-bang-champions-league-2013-14-298.html">
                        &nbsp;►&nbsp;Những điều cần biết về lễ bốc thăm chia bảng Champions League 2013/14
                    </a>
                </p>
                8
                <p>
                    <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/bong-da/ha-chelsea-real-madrid-vo-dich-international-champions-cup-293.html">
                        &nbsp;►&nbsp;Hạ Chelsea, Real Madrid vô địch International Champions Cup
                    </a>
                </p>
                9
                <p>
                    <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/bong-da/bang-xep-hang-fifa-thang-8-tbn-so-1-dt-viet-nam-hang-4-dong-nam-a-292.html">
                        &nbsp;►&nbsp;Bảng xếp hạng FIFA tháng 8: TBN số 1, ĐT Việt Nam hạng 4 Đông Nam Á
                    </a>
                </p>
                10
                <p>
                    <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/bong-da/vo-dich-va-tru-hang-v-league-dung-mo-chuyen-cong-bang-290.html">
                        &nbsp;►&nbsp;Vô địch và trụ hạng V-League: Đừng mơ chuyện công bằng
                    </a>
                </p>
                11
                <p>
                    <a class="tit1" key="left:49894,boxNewsArticles:5815" href="http://dudoanthethao.com.vn/bong-da/cho-ca-cuoc-bong-da-muc-toi-da-1-trieu-dong-ngay-287.html">
                        &nbsp;►&nbsp;Cho cá cược bóng đá mức tối đa 1 triệu đồng/ngày
                    </a>
                </p>
                12
            </div>
        </div>
    </div>
</div> 